package com.xzl.xep.web.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.xzl.xep.exception.BusinessException;
import com.xzl.xep.web.interseptor.Config;
import com.xzl.xep.web.interseptor.WebConstants;



/**
 * 系统初始化监听器
 * 
 * @author Maty Chen
 * @date 2011-12-16 下午11:26:14
 */
public class SystemInitListener implements ServletContextListener {


	
	@Override
	public void contextInitialized(ServletContextEvent sce) {
		//ServletContext servletContext = sce.getServletContext();
		try {
			Config.init(WebConstants.DEFAULT_CONF_FILE);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			throw new BusinessException("read config error!");
		}
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {

	}

}
